|
|
|
|
|
|
|
Figure 4.4
Example program FMetrics uses the GetTextMetrics API
function to obtain detailed information about a font's geometry. |
|
|
|
|
|
|
|
|
Using a drawing object's Font property, you can make the object display text using one of the standard fonts available on your system. You can also use the CreateFont API function to build customized versions of many fonts. These fonts can be unusually tall and thin, unusually short and wide, or rotated at an angle. |
|
|
|
|
|
|
|
|
With 14 arguments, CreateFont is one of the more complicated API functions. Its Visual Basic declaration is: |
|
|
|
 |
|
|
|
|
Private Declare Function CreateFont Lib "gdi32" _
Alias "CreateFontA" ( _
ByVal Height As Long, _
ByVal Width As Long, _ |
|
|
|
|
|
|
|
|
Figure 4.5
Example program Styles2 uses the GetTextMetrics API
function to align the baselines of text in different fonts. |
|
|
|
|
|